package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLGraphics;
import HLLib.game.HLCamera;

public class HLClassCamera extends HLLibClass {
    public HLClassCamera(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLCamera();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLCamera) self).RefreshRealPos();
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                ((HLCamera) self).WorldXToScreen(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLCamera) self).WorldXToScreen(args.GetInt(0)));
            }
            break;
        }
        case 2: {
            if (resultOwnerObject == null) {
                ((HLCamera) self).WorldYToScreen(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLCamera) self).WorldYToScreen(args.GetInt(0)));
            }
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                ((HLCamera) self).ScreenXToWorld(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLCamera) self).ScreenXToWorld(args.GetInt(0)));
            }
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                ((HLCamera) self).ScreenYToWorld(args.GetInt(0));
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLCamera) self).ScreenYToWorld(args.GetInt(0)));
            }
            break;
        }
        case 5: {
            ((HLCamera) self).SetSize(args.GetInt(0), args.GetInt(1));
            break;
        }
        case 6: {
            ((HLCamera) self).SetPos(args.GetInt(0), args.GetInt(1));
            break;
        }
        case 7: {
            ((HLCamera) self).RenderEx((HLGraphics)args.GetObject(0), args.GetInt(0), args.GetInt(1));
            break;
        }
        case 8: {
            ((HLCamera) self).Render((HLGraphics)args.GetObject(0));
            break;
        }
        }
    }
}
